import requests
import os


def download_audio(url: str, filename: str) -> str:
    response = requests.get(url)
    response.raise_for_status()
    
    with open(filename, "wb") as f:
        f.write(response.content)
    
    return filename


def download_image(url: str, filename: str) -> str:
    response = requests.get(url)
    response.raise_for_status()
    
    with open(filename, "wb") as f:
        f.write(response.content)
    
    return filename


def cleanup_temp_files(temp_files: list):
    """
    清理临时文件 - 现在保留所有文件，不执行删除操作
    这个函数保留是为了兼容性，但不会删除任何文件
    """
    # 不再删除任何文件，保留所有记录供查看
    pass